package com.jxgm.spring.boot.entity;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

import java.util.Arrays;
import java.util.Map;

/**
 * @author Administrator
 * @date 2020/9/9 10:25
 * @description
 **/
@Component
@ConfigurationProperties(prefix = "person")
//@PropertySource(value = {"classpath:person.properties"},encoding = "utf-8")
public class Person {

    private Integer id;
    private String name;
    private Integer age;
    private String grade;
    private Boolean graduate;
    private String[] subject;
    private Map<String,String> teacher;
    private Address address;

    public Person() {
    }

    public Person(Integer id, String name, Integer age, String grade, Boolean graduate, String[] subject, Map<String, String> teacher, Address address) {
        this.id = id;
        this.name = name;
        this.age = age;
        this.grade = grade;
        this.graduate = graduate;
        this.subject = subject;
        this.teacher = teacher;
        this.address = address;
    }

    @Override
    public String toString() {
        return "Person{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", age=" + age +
                ", grade='" + grade + '\'' +
                ", graduate=" + graduate +
                ", subject=" + Arrays.toString(subject) +
                ", teacher=" + teacher +
                ", address=" + address +
                '}';
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    public String getGrade() {
        return grade;
    }

    public void setGrade(String grade) {
        this.grade = grade;
    }

    public Boolean getGraduate() {
        return graduate;
    }

    public void setGraduate(Boolean graduate) {
        this.graduate = graduate;
    }

    public String[] getSubject() {
        return subject;
    }

    public void setSubject(String[] subject) {
        this.subject = subject;
    }

    public Map<String, String> getTeacher() {
        return teacher;
    }

    public void setTeacher(Map<String, String> teacher) {
        this.teacher = teacher;
    }

    public Address getAddress() {
        return address;
    }

    public void setAddress(Address address) {
        this.address = address;
    }
}
